@extends('wap.layouts.master')
@section('title','待评价')

@section('content')

<div class="aw-main aw-user aw-user-order">
	<!--vs信息-开始-->
	<ul class="aw-assest-list aw-assest-vs-match">
		<li class="aw-bg-fff aw-list-li">
			<div class="aw-li-title aw-vs-title">
				<div class="aw-title-left">@{{info.time}}</div>
				<div class="aw-title-right">@{{address.storefront_name}}<span>｜</span>@{{address.type_text}} (@{{address.number}}号)</div>
			</div>
			<div class="aw-li-desc aw-vs-desc">
				<div class="aw-vs-desc-zhandui aw-pr20">
					<span class="aw-desc-zhandui-img"><img :src="team_info_master.img ? team_info_master.img : '/img/default_160_160.png'" onerror="javascript:this.src='/img/default_160_160.png';"></span>
					@{{team_info_master.name}}
				</div>
				<div class="aw-vs-desc-zhandui aw-pl20">
					<span class="aw-desc-zhandui-img"><img :src="team_info_slave.img ? team_info_slave.img : '/img/default_160_160.png'" onerror="javascript:this.src='/img/default_160_160.png';"></span>
					@{{team_info_slave.name}}
				</div>
				<p class="aw-color-FF5450 aw-vs-desc-vs">VS</p>
			</div>
			<div class="aw-clear-both"></div>
			<div class="aw-li-foot-desc">
				<p class="aw-color-FFA800 aw-float-left">待评价</p>
				<p class="aw-color-777 aw-float-right">约战价格<span class="aw-color-2">￥@{{info.money}}</span></p>
			</div>
		</li>
	</ul>
	<ul class="aw-assest-form aw-bg-fff aw-mt10">
		<li class="aw-form-li aw-pl10">
			<div class="aw-left"><i class="aw-icon aw-icon-user-san aw-icon-user-evaluate"></i>对手评价</div>
			<div class="aw-conter aw-conter-team aw-assest-tag-list aw-mt45 aw-boder-top aw-pt10">
				<div class="aw-assest-tag-li" v-for="list in list_tags" :data-id="list.id">
					<a href="javascript:;" class="aw-assest-btn aw-btn-bordercolor-333 aw-btn-radius">@{{list.content}}</a>
				</div>
			</div>
			<div class="aw-pb30 aw-pl20 aw-pr20"><a href="javascript:;" v-on:click="Btn_Evaluate()" class="aw-assest-btn aw-btn-bgcolor-lvse">提交</a></div>
		</li>
	</ul>
</div>

@section('pagejs')
@parent
<script type="text/javascript">
var MJS_URLArry=URLArry;
var Vue_Data={
	info:{},//订单详情
	address:{},//场地详情
	team_info_master:{},//主队信息
	team_info_slave:{},//客队信息
	list_tags:{},//客队信息
};
//获取订单详情
var AD_info={
	api:'/api/order/order-info',
	form_data:{order_id:MJS_URLArry.order_id},
	tips:false,
}
getData(AD_info,function(ajax_data){
	Vue_Data.info=ajax_data;
	Vue_Data.address=ajax_data.address;
	Vue_Data.team_info_master=ajax_data.team_info.master;
	Vue_Data.team_info_slave=ajax_data.team_info.slave;
})
//获取标签列表
var AD_list={
	api:'/api/comment/list',
	form_data:{},
	tips:false,
}
getData(AD_list,function(ajax_data){
	Vue_Data.list_tags=ajax_data.list;
})
var vm=new Vue({
	el:'#Vue-body',
	data:Vue_Data,
	methods:{
		Btn_Evaluate:function(){
			var List=$('.aw-assest-tag-list');
			var Li=$('.aw-assest-tag-li.hover');
			var ids=[]
			Li.each(function(){
				var id=$(this).attr('data-id')
				ids.push(id)
			})
			List.attr('data-ids',ids)
			var Vids=List.attr('data-ids')
			var AD_eva={
				api:'/api/comment/add',
				form_data:{order_id:MJS_URLArry.order_id,content_id:Vids,team_id:this.info.team_id},
				tips:'评价成功',
				to_url:'/wap/order/list',
			}
			postData(AD_eva)
		}
	}
})
$(document).on('click','.aw-assest-tag-li',function(){
	$(this).toggleClass('hover')
})
</script>
@endsection

@endsection

